<?php $this->load->view('common/default_header.php');?>
<section class="trade">
    <div class="acbox">
        <div class="tj_wx">
            <img src="/invite/showqrcode?url=<?php echo $url;?>" width="180px"/>

        </div>
        <div class="text-center cw">
            <b class="fs16"><?php echo $userData['nickname'];?></b>
            <p>手机：<?php echo hideStr($userData['phone'],3,4,4)?></p>
            <!-- <p class="wx_txt">将此二维码推荐给朋友获得交易额1%的佣金提成</p> -->
        </div>
    </div>
    <?php if(!empty($user_info)){?>
    <ul class="ul-menu weui_media_box">
        <?php if(false){?><li onclick="javascript:location.href='/invite/earn'"><i class="icon6"></i><span>我的收入</span><i class="r_ico"></i></li><?php }?>
        <li onclick="javascript:location.href='/invite/poster'"><i class="icon9"></i><span>推广海报</span><i class="r_ico"></i></li>
        <li onclick="javascript:location.href='/invite/details'"><i class="icon7"></i><span>推荐明细</span><i class="r_ico"></i></li>
        <li onclick="javascript:location.href='/invite/tradeDetails'"><i class="icon4"></i><span>交易明细</span><i class="r_ico"></i></li>
        <li onclick="javascript:location.href='/invite/help'"><i class="icon5"></i><span>经纪人介绍</span><i class="r_ico"></i></li>
    </ul>
    <?php }else{?>
    <div class="relubox" style="border: none;">
        <p class="title">产品优势</p>
        <p>要点啥微盘在同类平台中交易品种最为丰富，覆盖了新华A50指数、道琼斯指数、黄金和原油等国际主流品种。要点啥微盘有交易门槛低、简单易上手的特点，只需10元即可交易，操作简单一目了然。另外要点啥微盘出入金最为简便，用户可使用微信支付和银行卡来进行充值与提现操作。</p>
        
    </div>
    <div class="relubox" style="border: none;">
        <a href="javascript:showLoginDialog()" class="btn btn-block btn-warning btn-lg">立即登陆</a>
    </div>
    <?php }?>

</section>

<script src="<?php echo js_url("/wcp/jquery-1.9.1.min.js"); ?>?20160329001" type="text/javascript"></script>
<script src="<?php echo js_url("/wcp/bootstrap.min.js"); ?>?20160329001" type="text/javascript"></script>
<script src="<?php echo js_url("/wcp/main.js"); ?>?20160329001" type="text/javascript"></script>
<script src="<?php echo js_url("/wcp/bootstrap-dialog.min.js"); ?>?20160329001" type="text/javascript"></script>
<script type="text/javascript">



var loginHtml = '<form method="post" accept-charset="utf-8" id="loginForm" onsubmit="return false;">';
loginHtml += '<div class="form-group">';
loginHtml += '<input type="password" name="password" class="form-control" id="password" placeholder="交易密码">';
loginHtml += '</div>';
loginHtml += '<div class="checkbox"><label>';
loginHtml += '<input type="checkbox" name="isFree" class="label-control" id="isFree" value="1">免密码登陆';
loginHtml += '</label></div>';
loginHtml += '<a href="javascript:login()" class="btn btn-block btn-warning">确认</a>';
loginHtml += '<div class="form-group text-center" style="margin-top:15px">';
loginHtml += '<label><a href="javascript:forgotPwd();">忘记交易密码？</a></label>';
loginHtml += '<input type="hidden" name="redirect" id="redirect" value="/invite"></div>';
loginHtml += '</form>';

function showLoginDialog(){
    window.loginDialog = new BootstrapDialog({
        title: '输入交易密码',
        closable:true,
        type: BootstrapDialog.TYPE_DEFAULT,
        message: loginHtml
    });
    window.loginDialog.open();
}

function login(){
    var passwd = $('#loginForm #password').val();
    if(passwd==''){
        myAlert("请输入交易密码");
        return;
    }
    $.ajax({
        type: "POST",
        url: "/api/user/login",
        dataType: 'json',
        data: $("#loginForm").serialize(),
        success: function(data){
            if(data.code==0){
                location.href=data.redirect;
            }else{
                myAlert(data.message);
            }
        },
        error: function(XHR,textStatus,errorThrown) {
            myAlert("无效请求");
        }
    });
}
</script>


<?php $this->load->view('common/wx_share.php');?>